<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-boxinfo-add">
			<input name="boxSsqyid"  type="hidden" id="treeId"/>
			<div class="form-group">	
				<label class="col-sm-3 control-label">名称：</label>
				<div class="col-sm-8">
					<input id="boxName" name="boxName" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">地址：</label>
				<div class="col-sm-8">
					<input id="boxDz" name="boxDz" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">所属区域：</label>
				<div class="col-sm-8">
					<input id="treeName" name="boxSsqymc" onclick="selectDeptTree()" readonly="true"  class="form-control" type="text">
				</div>
			</div>

			<div class="form-group">	
				<label class="col-sm-3 control-label">设备编号：</label>
				<div class="col-sm-8">
					<input id="boxSbbh" name="boxSbbh" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">副柜个数：</label>
				<div class="col-sm-8">
					<input id="boxFbgs" name="boxFbgs" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">柜子状态</label>
				<div class="col-sm-8">
					<select id="boxType" name="boxType" class="form-control">
						<option value ="1">正常</option>
						<option value ="0">初始注册</option>
						<option value ="2">停用</option>						
					</select>
					
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">柜子是否计费</label>
				<div class="col-sm-8">
				<select id="boxSfqk" name="boxSfqk" class="form-control">
						<option value ="1">计费</option>
						<option value ="0">包柜</option>	
						<option value ="3">业主收费</option>								
					</select>
					
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">服务电话：</label>
				<div class="col-sm-8">
					<input id="boxFwdh" name="boxFwdh" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">
				<div class="form-control-static col-sm-offset-9">
					<button type="submit" class="btn btn-primary">提交</button>
					<button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
					
					
				</div>
			</div>
		</form>
	</div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "ebox/boxinfo"
		$("#form-boxinfo-add").validate({
			rules:{
				boxName:{
					required:true,
				},
				boxSsqyid:{
					required:true,
				},
				boxFbgs:{
					required:true,
				},
                boxFwdh:{
                    required:true,
                },
			},
			submitHandler: function(form) {
				$.operate.save(prefix + "/add", $('#form-boxinfo-add').serialize());
			}
		});
        /*用户管理-新增-选择部门树*/
        function selectDeptTree() {
            var treeId = $("#treeId").val();
            var deptId = treeId == null || treeId == "" ? "100" : treeId;
            var url = ctx + "system/dept/selectDeptTree/" + deptId;
            $.modal.open("选择部门", url, '380', '380');
        }
	</script>
</body>
</html>
